/**
 * fulihui.com Inc.
 * Copyright (c) 2015-2017 All Rights Reserved.
 */
package com.fulihui.wgj.auth.common;

/**
 * @author: Levon
 * @version: v 0.1 2017-06-05 15:06
 */
public class WxMsgBuild {

    /**
     * 构造文本消息
     * @param content 文本消息内容
     * @return 文本消息XML字符串
     */
    public static String buildTextMessage( String toUserName,String fromUserName, String content) {
        return String.format(
                "<xml>" +
                        "<ToUserName><![CDATA[%s]]></ToUserName>" +
                        "<FromUserName><![CDATA[%s]]></FromUserName>" +
                        "<CreateTime>%s</CreateTime>" +
                        "<MsgType><![CDATA[text]]></MsgType>" +
                        "<Content><![CDATA[%s]]></Content>" +
                        "</xml>",
                toUserName, fromUserName, System.currentTimeMillis(), content);
    }
}
